package core;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

/**
 * Created by IntelliJ IDEA.
 * User: Jake
 * Date: 19/12/11
 * Time: 18:04
 * To change this template use File | Settings | File Templates.
 */
public class KeyController implements KeyListener {
    public void keyTyped(KeyEvent e) {

    }

    public void keyPressed(KeyEvent e) {
        switch (e.getID()) {
            case KeyEvent.VK_DOWN:
                GameEngine.downKey=true;
            case KeyEvent.VK_UP:
                GameEngine.upKey=true;
            case KeyEvent.VK_RIGHT:
                GameEngine.rightKey=true;
            case KeyEvent.VK_LEFT:
                GameEngine.leftKey=true;
        }
    }

    public void keyReleased(KeyEvent e) {
        switch (e.getID()) {
            case KeyEvent.VK_DOWN:
                GameEngine.downKey=false;
            case KeyEvent.VK_UP:
                GameEngine.upKey=false;
            case KeyEvent.VK_RIGHT:
                GameEngine.rightKey=false;
            case KeyEvent.VK_LEFT:
                GameEngine.leftKey=false;
        }    }
}
